/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dio.com.view;

import dio.com.model.bean.ResumoBean;
import java.math.RoundingMode;

/**
 *
 * @author Diogenes
 */
public class Resumo extends javax.swing.JDialog {

    /**
     * Creates new form Resumo
     */
    ResumoBean resumo;
    public Resumo(java.awt.Frame parent, boolean modal, ResumoBean r) {
        super(parent, modal);
        initComponents();
        resumo = r;
        setLocationRelativeTo(null);
        publicarResumo();
    }
    
    private void publicarResumo(){
        tfAdicional.setText("R$" + resumo.getAdicionalirpj().setScale(4, RoundingMode.HALF_DOWN).toString());
        tfCofins.setText("R$" + resumo.getCofins().setScale(4, RoundingMode.HALF_DOWN).toString());
        tfComissao.setText("R$" + resumo.getComissãosvendas().setScale(4, RoundingMode.HALF_DOWN).toString());
        tfDesCartaoCredito.setText("R$" + resumo.getDespesasfinanceiras().setScale(4, RoundingMode.HALF_DOWN).toString());
        tfDespesas.setText("R$" + resumo.getDespesasoperacionais().setScale(4, RoundingMode.HALF_DOWN).toString());
        tfFornecedorFrete.setText("R$" + resumo.getFornecedorfrete().setScale(4, RoundingMode.HALF_DOWN).toString());
        tfFornecedorMercadoria.setText("R$" + resumo.getFornecedormercadorias().setScale(4, RoundingMode.HALF_DOWN).toString());
        tfICMS.setText("R$" + resumo.getIcms().setScale(4, RoundingMode.HALF_DOWN).toString());
        tfCsll.setText("R$" + resumo.getCsll().setScale(4,RoundingMode.HALF_DOWN).toString());
        tfIRPJ.setText("R$" + resumo.getIrpj().setScale(4, RoundingMode.HALF_DOWN).toString());
        tfLucro.setText("R$" + resumo.getLucro().setScale(4, RoundingMode.HALF_DOWN).toString());
        tfPIS.setText("R$" + resumo.getPis().setScale(4, RoundingMode.HALF_DOWN).toString());
        tfPerda.setText("R$" + resumo.getPerdadeestoques().setScale(4, RoundingMode.HALF_DOWN).toString());
        
        lblPrecoVenda.setText(lblPrecoVenda.getText() + " RS: "+ resumo.getPrecoVenda().toString());
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        tfFornecedorMercadoria = new javax.swing.JTextField();
        tfFornecedorFrete = new javax.swing.JTextField();
        tfPIS = new javax.swing.JTextField();
        tfCofins = new javax.swing.JTextField();
        tfDesCartaoCredito = new javax.swing.JTextField();
        tfIRPJ = new javax.swing.JTextField();
        tfICMS = new javax.swing.JTextField();
        tfAdicional = new javax.swing.JTextField();
        tfComissao = new javax.swing.JTextField();
        tfPerda = new javax.swing.JTextField();
        tfDespesas = new javax.swing.JTextField();
        tfLucro = new javax.swing.JTextField();
        tfCsll = new javax.swing.JTextField();
        lblPrecoVenda = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("RESUMO DOS VALORES DE TODOS OS IMPOSTOS");

        jLabel1.setText("FORNECEDOR/MERCADORIAS ");

        jLabel2.setText("FORNECEDOR/FRETE ");

        jLabel3.setText("PIS");

        jLabel4.setText("COFINS");

        jLabel5.setText("DESP. FINANC/CARTÃO DE CRÉDITO");

        jLabel6.setText("ICMS");

        jLabel7.setText("IRPJ");

        jLabel8.setText("ADICIONAL IRPJ");

        jLabel9.setText("COMISSAO S/ VENDAS");

        jLabel10.setText("PERDAS DE ESTOQUE");

        jLabel11.setText("DESPESAS OPERACIONAIS");

        jLabel12.setText("LUCRO");

        jLabel13.setText("CSLL");

        tfFornecedorMercadoria.setEditable(false);
        tfFornecedorMercadoria.setEnabled(false);

        tfFornecedorFrete.setEditable(false);
        tfFornecedorFrete.setEnabled(false);

        tfPIS.setEditable(false);
        tfPIS.setEnabled(false);

        tfCofins.setEditable(false);
        tfCofins.setEnabled(false);

        tfDesCartaoCredito.setEditable(false);
        tfDesCartaoCredito.setEnabled(false);

        tfIRPJ.setEditable(false);
        tfIRPJ.setEnabled(false);

        tfICMS.setEditable(false);
        tfICMS.setEnabled(false);

        tfAdicional.setEditable(false);
        tfAdicional.setEnabled(false);

        tfComissao.setEditable(false);
        tfComissao.setEnabled(false);

        tfPerda.setEditable(false);
        tfPerda.setEnabled(false);

        tfDespesas.setEditable(false);
        tfDespesas.setEnabled(false);

        tfLucro.setEditable(false);
        tfLucro.setEnabled(false);

        tfCsll.setEditable(false);
        tfCsll.setEnabled(false);

        lblPrecoVenda.setBackground(new java.awt.Color(255, 51, 51));
        lblPrecoVenda.setText("Preço de Venda:");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(lblPrecoVenda)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel1)
                            .addComponent(jLabel6)
                            .addComponent(jLabel5)
                            .addComponent(jLabel4)
                            .addComponent(jLabel3)
                            .addComponent(jLabel2)
                            .addComponent(jLabel13))
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(tfFornecedorMercadoria, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(tfFornecedorFrete)
                            .addComponent(tfPIS)
                            .addComponent(tfCofins)
                            .addComponent(tfDesCartaoCredito)
                            .addComponent(tfICMS)
                            .addComponent(tfCsll))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel12)
                            .addComponent(jLabel11)
                            .addComponent(jLabel10)
                            .addComponent(jLabel9)
                            .addComponent(jLabel8)
                            .addComponent(jLabel7))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(tfIRPJ, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(tfAdicional)
                    .addComponent(tfComissao)
                    .addComponent(tfPerda)
                    .addComponent(tfDespesas)
                    .addComponent(tfLucro))
                .addGap(24, 24, 24))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel7)
                            .addComponent(tfIRPJ, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel8)
                            .addComponent(tfAdicional, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel9)
                            .addComponent(tfComissao, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel10)
                            .addComponent(tfPerda, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel11)
                            .addComponent(tfDespesas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel12)
                            .addComponent(tfLucro, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel1)
                            .addComponent(tfFornecedorMercadoria, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel2)
                            .addComponent(tfFornecedorFrete, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel3)
                            .addComponent(tfPIS, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel4)
                            .addComponent(tfCofins, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel5)
                            .addComponent(tfDesCartaoCredito, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel6)
                            .addComponent(tfICMS, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jLabel13)
                        .addGap(18, 18, 18)
                        .addComponent(lblPrecoVenda))
                    .addComponent(tfCsll, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(37, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
     * s@param args the command line arguments
     */
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JLabel lblPrecoVenda;
    private javax.swing.JTextField tfAdicional;
    private javax.swing.JTextField tfCofins;
    private javax.swing.JTextField tfComissao;
    private javax.swing.JTextField tfCsll;
    private javax.swing.JTextField tfDesCartaoCredito;
    private javax.swing.JTextField tfDespesas;
    private javax.swing.JTextField tfFornecedorFrete;
    private javax.swing.JTextField tfFornecedorMercadoria;
    private javax.swing.JTextField tfICMS;
    private javax.swing.JTextField tfIRPJ;
    private javax.swing.JTextField tfLucro;
    private javax.swing.JTextField tfPIS;
    private javax.swing.JTextField tfPerda;
    // End of variables declaration//GEN-END:variables
}
